Simple Mechanical Algorithm - Intro to Computer Science
Simple Mechanical Algorithm
Simple Mechanical Algorith:
days = 0 while date1 is before date2: date1 = advance to next day days += 1
Roughly how long will it take a Python program using this approach to count days between 12 Dec 1912 and 12 Dec 2012?
A few nanoseconds
A few milliseconds
A few seconds
A few minutes
A few hours
Way too long!